<?php
/**
 * Created by PhpStorm.
 * User: zd
 * Date: 2019/4/27
 * Time: 14:53
 */

namespace app\api\model;


class Logistics extends BaseModel
{
    protected $autoWriteTimestamp = true;

    /**
     * 添加快递信息
     * @param $data
     * @return Logistics
     */
    public static function addLogistics($order_id,$user_id,$sender_id,$data){
        $logistics = new Logistics();
        $logistics->data([
            'order_id'  => $order_id,
            'user_id' =>  $user_id,
            'sender_id'=>$sender_id,
            'delivery_name'=>$data['delivery_name'],
            'waybill_id'=>$data['waybill_id']
        ]);
        $logistics->save();
        return $logistics;
    }


}